From: Anthony PERARD Date: Wed, 11 Dec 2019 15:27:33 +0000 (+0000) Subject: xen: Use $(CONFIG_CC_IS_CLANG) instead of $(clang) in Makefile X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~779 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=67c5d662d768311fae9c7035b305078b81b23909;p=xen.git xen: Use $(CONFIG_CC_IS_CLANG) instead of $(clang) in Makefile Kconfig can check if $(CC) is clang or not, if it is CONFIG_CC_IS_CLANG will be set. With that patch, the hypervisor can be built using clang by running `make CC=clang CXX=clang++` without needed to provide an extra clang parameter. `make clang=y` still works as Config.mk will set CC and CXX. Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper --- diff --git a/xen/Rules.mk b/xen/Rules.mk index 2bd269bb8a..d22a16d282 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -64,7 +64,7 @@ CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS-$(CONFIG_DEBUG_INFO) += -g CFLAGS += '-D__OBJECT_FILE__="$@"' -ifneq ($(clang),y) +ifneq ($(CONFIG_CC_IS_CLANG),y) # Clang doesn't understand this command line argument, and doesn't appear to # have an suitable alternative. The resulting compiled binary does function, # but has an excessively large symbol table. @@ -122,7 +122,7 @@ subdir-all := $(subdir-y) $(subdir-n) $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY ifeq ($(CONFIG_COVERAGE),y) -ifeq ($(clang),y) +ifeq ($(CONFIG_CC_IS_CLANG),y) COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping else COV_FLAGS := -fprofile-arcs -ftest-coverage @@ -139,7 +139,7 @@ endif ifeq ($(CONFIG_LTO),y) CFLAGS += -flto -LDFLAGS-$(clang) += -plugin LLVMgold.so +LDFLAGS-$(CONFIG_CC_IS_CLANG) += -plugin LLVMgold.so # Would like to handle all object files as bitcode, but objects made from # pure asm are in a different format and have to be collected separately. # Mirror the directory tree, collecting them as built_in_bin.o. @@ -193,7 +193,7 @@ SRCPATH := $(patsubst $(BASEDIR)/%,%,$(CURDIR)) %.o: %.c Makefile ifeq ($(CONFIG_ENFORCE_UNIQUE_SYMBOLS),y) $(CC) $(CFLAGS) -c $< -o $(@D)/.$(@F).tmp -MQ $@ -ifeq ($(clang),y) +ifeq ($(CONFIG_CC_IS_CLANG),y) $(OBJCOPY) --redefine-sym $<=$(SRCPATH)/$< $(@D)/.$(@F).tmp $@ else $(OBJCOPY) --redefine-sym $(